Skip to content

fix: support @ngx-translate/core v18#736

Open
artaommahe wants to merge 1 commit into
GetStream:masterfrom
artaommahe:fix/ngx-translate-v18
Open

fix: support @ngx-translate/core v18#736
artaommahe wants to merge 1 commit into
GetStream:masterfrom
artaommahe:fix/ngx-translate-v18

Conversation

@artaommahe

Copy link
Copy Markdown

Problem

@ngx-translate/core v18 removed the TranslateModule NgModule. stream-chat-angular's feature modules import it, so any consumer on v18 fails to build with:

No matching export in ".../ngx-translate-core.mjs" for import "TranslateModule"

(Reported in #735 — Angular 21 + @ngx-translate/core 18.)

Fix

The 9 feature modules imported TranslateModule only to expose the translate pipe/directive in their templates. This replaces it with the standalone TranslatePipe and TranslateDirective in each imports array. These have been standalone since @ngx-translate/core v15, so the change is backward compatible with v17.

The peer dependency is widened to ^17.0.0 || ^18.0.0.

No TranslateService changes are needed — the code already uses the v18-era getFallbackLang() / setFallbackLang() API.

Testing

ng build stream-chat-angular passes against both @ngx-translate/core@17 and @ngx-translate/core@18, and the built bundle no longer imports TranslateModule (it now imports TranslateDirective, TranslatePipe). Existing specs are unchanged.

Closes #735

ngx-translate v18 removed the `TranslateModule` NgModule. The library's
9 feature modules imported it solely to make the `translate` pipe and
directive available in their templates, which breaks consumers on v18
with "No matching export ... for import 'TranslateModule'".

Replace `TranslateModule` with the standalone `TranslatePipe` and
`TranslateDirective` in each module's `imports`. These have been
standalone since @ngx-translate/core v15, so the change is backward
compatible with v17. No `TranslateService` usage changes are needed —
the library already uses the v18-era `getFallbackLang()` /
`setFallbackLang()` API.

Widen the peer dependency to `^17.0.0 || ^18.0.0`.

Closes GetStream#735

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatible with @ngx-translate/core v18 — TranslateModule import fails the build

1 participant